package com.javasm.exercise;

/**
 * @classname:Car
 * @description:
 * @author: Mr.Z
 * @date: 2020/11/27 17:45
 * @version: 0.1
 * @since:1.8
 */
public class Car {
    //使用java来描述车class，车都具备轮子数、颜色 、与跑的行为，
    private int wheel;
    private String color;
    private CarFactory carFactory;
    public Car() {
    }

    public Car(int wheel, String color) {
        this.wheel = wheel;
        this.color = color;
    }

    public CarFactory getCarFactory() {
        return carFactory;
    }

    public void setCarFactory(CarFactory carFactory) {
        this.carFactory = carFactory;
    }

    public int getWheel() {

        return wheel;
    }

    public void setWheel(int wheel) {
        if(wheel!=4){
            carFactory.fix();
        }
        this.wheel = wheel;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public static void run(){

    }

}
